"""
@-*- coding: utf-8 -*-
@ python: 3.12.3
@ 创建者: JacksonCode
@ 创建时间: 2025-11-06
@ 描述: 用户相关API路由
"""
from flask import Blueprint
from app.controllers.users import UserController

# 创建用户蓝图
users_bp = Blueprint('users', __name__, url_prefix='/users')


@users_bp.route("/", methods=["GET"])
def get_users():
    """获取用户列表"""
    return UserController.get_users()


@users_bp.route("/<int:user_id>", methods=["GET"])
def get_user(user_id):
    """获取指定用户信息"""
    return UserController.get_user(user_id)


@users_bp.route("/<int:user_id>", methods=["DELETE"])
def delete_user(user_id):
    """删除用户"""
    return UserController.delete_user(user_id)


@users_bp.route("/<int:user_id>/activate", methods=["POST"])
def activate_user(user_id):
    """激活用户"""
    return UserController.activate_user(user_id)


@users_bp.route("/<int:user_id>/deactivate", methods=["POST"])
def deactivate_user(user_id):
    """停用用户"""
    return UserController.deactivate_user(user_id)